package com.lifang.imgsoa.util;

import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public enum Global {
	;
	private static final Logger logger = LoggerFactory.getLogger(Global.class);

	/************************************** 阿里云 存储 ***********************************************/
	// 原图
	public final static String ACCESSKEYID_ORIGINAL;
	public final static String ACCESSKEYSECRET_ORIGINAL;
	public final static String BUCKETNAME_ORIGINAL;

	// 水印
	public final static String ACCESSKEYID_WATER;
	public final static String ACCESSKEYSECRET_WATER;
	public final static String BUCKETNAME_WATER;

	public final static int ALIYUN_ECS;
	public final static String ALIYUN_INTERNAL;
	

	static {
		ACCESSKEYID_ORIGINAL = Config.get("S_constants.ACCESSKEYID_ORIGINAL");
		ACCESSKEYSECRET_ORIGINAL = Config.get("S_constants.ACCESSKEYSECRET_ORIGINAL");
		BUCKETNAME_ORIGINAL = Config.get("S_constants.BUCKETNAME_ORIGINAL");

		ACCESSKEYID_WATER = Config.get("S_constants.ACCESSKEYID_WATER");
		ACCESSKEYSECRET_WATER = Config.get("S_constants.ACCESSKEYSECRET_WATER");
		BUCKETNAME_WATER = Config.get("S_constants.BUCKETNAME_WATER");

		ALIYUN_ECS = Config._get("I_constants.ALIYUN_ECS");
		ALIYUN_INTERNAL = Config.get("S_constants.ALIYUN_INTERNAL");
		
		
		
		
		
		
		
		
		
		
		
		
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	private static class Config {

		static Properties properties = new Properties();
		static {
			try {
				properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"));
			} catch (Exception e) {
				logger.error("config.properties error!!!", e);
			}

		}

		public static String get(String key) {
			return properties.getProperty(key);
		}

		public static Integer _get(String key) {
			return Integer.parseInt(properties.getProperty(key));
		}

	}
}
